package cn.jhz.learn.blog.controller.security;

import cn.jhz.learn.blog.component.ValidationHolder;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class RequestInitializationAspect {

    @Pointcut("execution(* cn.jhz.learn.blog.controller.core.*.*.*(..))")
    public void pointcut(){}

    @Before("pointcut()")
    public void initialization(){
        ValidationHolder.setParamHolder();
    }

    @After("pointcut()")
    public void destruction(){
        ValidationHolder.remove();
    }
}
